package chis.fx.handlers;

import javafx.event.EventHandler;
import javafx.scene.input.MouseEvent;

//class MyHandler implements EventHandler<ActionEvent> {
//    @Override
//    public void handle(ActionEvent event) {
//         System.out.println("My Very Own Private Button Handler");
//    }
//}

public class MyHandler implements EventHandler<MouseEvent> {
	@Override
	public void handle(MouseEvent event) {
		//event.MOUSE_CLICKED
		//		if (event.equals(event.MOUSE_CLICKED)) {
		//			System.out.println(event.getEventType());
		//		}
		//		
		//		if (event.equals(event.MOUSE_ENTERED)) {
		//			System.out.println(event.getEventType());
		//		}
		//		
		//		if (event.equals(event.MOUSE_EXITED)) {
		//			System.out.println(event.getEventType());
		//		}
		//		System.out.println("My Very Own Private Button Handler");
		//
		//		System.out.println(event.getEventType());
		//
		//		System.out.println("xxx" + event.getEventType().getName());

		switch (event.getEventType().getName()) {

		case "MOUSE_CLICKED":
			clicked(event);
			break;

		case "MOUSE_ENTERED":
			entered(event);
			break;

		case "MOUSE_EXITED":
			exited(event);
			break;

		}

	}

	private void clicked(MouseEvent e) {
		System.out.println("Clicked");
	}

	private void entered(MouseEvent e) {
		System.out.println("Entered");

	}

	private void exited(MouseEvent e) {
		System.out.println("exited");

	}




}
